<?php
	if(!isset($_REQUEST['id']) || $_REQUEST['id'] != "timkiem" || $_REQUEST['id'] != ''){
		$id='noidung';
	}
	else
		$id=$_REQUEST['id'];
	if(isset($_REQUEST['tn'])){
		$tn=$_REQUEST['tn'];
	}
	else
		$tn='0';
	$page = isset($_REQUEST['page']) ? $_REQUEST['page'] : '';
?>
<form name="tim" action=""  method="GET">
	<table width="100%" border="0">
    	<tr>
        	<td>
            <select name="tn" id="tn" onChange ="window.location.href='index.php?id=<?php echo $id; ?>&page=<?php echo $page; ?>&tn='+this.value" >					
            <?php
				$arr = array("----Loại tour----","Tour trong nước","Tour ngoài nước");
				foreach ($arr as $key => $value){
					if ($key==$tn)
						echo "<option value='$key' selected>$value</option>";
					else echo "<option value='$key'>$value</option>";
				}
			?>
			</select>
            </td>
     	</tr>
        <tr>
        	<td><label for="diemden"></label>
            	<select name="diemden" id="diemden">
                <?php
					if ($tn!=0) {
						$sql_1="select qldl_tinh_thanh_pho.THANH_PHO
							from qldl_tinh_thanh_pho
							inner join qldl_quoc_gia
							on qldl_tinh_thanh_pho.ma_quoc_gia=qldl_quoc_gia.ma_quoc_gia
							where ma_loai=".$tn;
						$result =$mysqli->query($sql_1);
						while ($row=$result->fetch_array()){
							echo "<option value='$row[0]'>".$row[0]."</option>";
						}
					}
					else echo "<option value='none'>----Điểm đến----</option>";
				?>
               	</select>
        	</td>
   		</tr>
        <tr>
        	<td><label for="gia"></label>
            	<select name="tugia" id="tugia">
                	<option value="none">----Từ giá----</option>
                    <?php
                    	$arr = array("1000000","2000000","5000000","6000000","8000000","10000000","11000000","12000000","15000000","19000000","20000000");
                    	foreach ($arr as $value){
							echo "<option value='$value'>".number_format($value,0,",",".")."</option>";
						}
					?>
                </select></td>
      	<tr>
        	<td><label for="gia"></label>
            	<select name="dengia" id="dengia">
                	<option value="none">----Đến giá----</option>
                	<?php
                    	$arr = array("3000000","4000000","7000000","9000000","13000000","14000000","15000000","16000000","17000000","18000000","30000000","35000000","40000000","45000000","80000000");
                    	foreach ($arr as $value){
							echo "<option value='$value'>".number_format($value,0,",",".")."</option>";
						}
					?>
               	</select></td>
      	</tr>
        <tr>
        	<td>
            	<input type="hidden" name="id" id="id" value="timkiem" />
            	<input type="submit" value="Tìm kiếm" class="nutnhan" /></td>
        </tr>
	</table>
</form>    
